<!DOCTYPE html>
<html lang="zxx">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="icon" href="images/favicon.png">
    <title></title>

    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="../css/materialize.css">
    <link rel="stylesheet" href="../css/loaders.css">
    <link rel="stylesheet" href="../css/lightbox.css">
    <link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css">
    <link rel="stylesheet" href="../css/owl.carousel.min.css">
    <link rel="stylesheet" href="../css/owl.theme.default.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/layer.css">

</head>
<style>
.center {
    width: unset;
}
.row .col.s6 {
    width: 50%;
    margin-left: auto;
    left: auto;
    right: auto;
    padding: 10px 0 0 0px;
}
</style>
<body>

<!-- navbar -->
<div class="navbar">
    <div class="container">
        <div class="row">
            <div class="col s9">
                <div class="content-left" onclick="javascript:history.back(-1);">
                    <i class="fa fa-chevron-left center"></i>
                </div>
            </div>

        </div>
    </div>

</div>
<!-- end navbar -->

<!-- sidebar -->
<div class="segments-page">
		<div class="container">
			<div class="pricing-table">
				<div class="pages-title">
					<h3>订单列表</h3>
					<div class="line"></div>
				</div>
				  <div class="weui-tab">
				 <div class="weui-navbar" style=" top:110px; left:0; right:0; height:44px; ">
				                <a class="weui-navbar__item proinfo-tab-tit font-14 weui-bar__item--on" href="#tab1">卖出</a>
				                <a class="weui-navbar__item proinfo-tab-tit font-14" href="#tab2">买入</a>
				            </div>
							
							  <div class="weui-tab__bd proinfo-tab-con" style="padding-top:18px;">
							                <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
							            
							                 <div class="row" id="container">
							                 
							                 
							                 </div>
							                </div>
							                <div id="tab2" class="weui-tab__bd-item" >
							                <div class="row" id="buyhtml">
							                
							                
							                </div>
							                </div>
							             
							            </div>
						<!-- 	<div id="tab1">
								<div class="row" id="container">
								
								
								</div>
							</div>
							  <div id="tab2" >
							                
				
						   </div> -->
			
			</div>
			</div>
		</div>
	</div>
<!-- end sidebar -->

<!-- list -->

<!-- end list -->

<script src="../js/jquery.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="../js/numscroller.js"></script>
<script src="../js/lightbox.js"></script>
<script src="../js/owl.carousel.min.js"></script>
<script src="../js/main.js"></script>
<script src="../js/layer.js"></script>
<script src="../js/jquerysession.js"></script>
<script src="../js/jquery.md5.js"></script>
<script src="../js/index.js"></script>
<script src="../js/jquery-weui.min.js"></script>
<script>

    $(document).ready(function () {
   
	var OrderListurl = 'Order/OrderList';
	var OrderListInfo = api_request(OrderListurl, 'GET');
		
				if(OrderListInfo.code==1 && OrderListInfo.data){
					var data = OrderListInfo.data;
					var html = '';
					var issuehtm = '';
				for (var i = 0; i < data.length; i++) {
					var ls =data[i];
					var type = ls.pattern;
					type = type == 0 ? '银行卡' : '支付宝';
					if(ls.sellType==1){
						html
						 += '' +
						'    <div class="col s6">' +
						'    <div class="contents z-depth-1 center">' +
						'      <h5>数量</h5>' +
						'      <h4>' + ls.Hangmoney + ' </h4>' +
						'        <ul style="padding: 10px;">'+
						'<li>手续费：' + ls.sxf + '</li>' +
						'<li>总价：' + ls.total + '</li> ' +
						' <li>支付方式：' + type + '</li>' +
						'  </ul>' +
						'  <button class="button button-full button-black z-depth-1" onclick="sell(' + ls.id + ');">卖出</button>' +
						'</div>' +
						'  </div>' 
						;
					}
				if(ls.sellType==2){
					issuehtm
					 += '' +
					'    <div class="col s6">' +
					'    <div class="contents z-depth-1 center">' +
					'      <h5>数量</h5>' +
					'      <h4>' + ls.Hangmoney + ' </h4>' +
					'        <ul style="padding: 10px;">'+
					'<li>手续费：' + ls.sxf + '</li>' +
					'<li>总价：' + ls.total + '</li> ' +
					' <li>支付方式：' + type + '</li>' +
					'  </ul>' +
					'  <button class="button button-full button-black z-depth-1" onclick="sell(' + ls.id + ');">买入</button>' +
					'</div>' +
					'  </div>' 
					;
				}
				}
					var issuehtmllist = document.getElementById("container");
					issuehtmllist.innerHTML += html;
					var buyhtmllist = document.getElementById("buyhtml");
					buyhtmllist.innerHTML += issuehtm;
				
				}
		
    });
			function sell(oid) {
					layer.open({
						content: '确定卖出吗？',
						btn: ['确定', '想想'],
						yes: function(index) {
							var sellurl = 'Order/sell';
							var parm = {
								oid: oid
							}
							var sellInfo = api_request(sellurl, 'POST', parm);

						}
					});
				}
</script>
</body>
</html>